#include "Common.hpp"


int main()
{
    key_t k = ftok(gpath.c_str(),gproj_id);
    if(k < 0)
    exit(1);
    std::cout << "k : " << ToHex(k) << std::endl;
    int shmid = shmget(k,gsize,IPC_CREAT | IPC_EXCL);//创建的共享内存必须是新的
    if(shmid == -1)
    exit(2);
    std::cout << "shmid: " << shmid << std::endl;
    
    sleep(10);
    shmctl(shmid,IPC_RMID,nullptr);

    return 0;
}